package com.apache.flow.core.manager;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.apache.core.orm.Page;
import com.apache.flow.core.dao.FlowHistoryDao;
import com.apache.flow.core.entity.FlowHistroy;

@Service
@Transactional
public class FlowHistoryManager {
	@Autowired
	private FlowHistoryDao flowHistoryDao;

	/**
	 * description:  添加历史
	 * @param flowHistroy  
	 * @author xyc 
	 * @update 2015-5-25
	 */
	public void save(FlowHistroy flowHistroy) {
		flowHistoryDao.save(flowHistroy);
	}

	/**
	 * description: 获取全部历史列表 
	 * @return  
	 * @author xyc 
	 * @update 2015-5-25
	 */
	public List<FlowHistroy> getAll() {
		return flowHistoryDao.getAll();
	}

	/**
	 * description:  根据条件查询历史列表
	 * @param map
	 * @return  
	 * @author xyc 
	 * @update 2015-5-25
	 */
	public Page<FlowHistroy> getHistoryByInfo(Map map, int pageNo, int pageSize) {
		return flowHistoryDao.getHistoryByInfo(map, pageNo, pageSize);
	};

	public int delFlowHistoryById(String hisId) {
		return flowHistoryDao.delFlowHisByProcessinsId(hisId);
	}

}
